package com.coincalf.wallet.entity;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * 用户tag memo表 用户EOS XRP充币的唯一标识
 * 用户充币时创建，即点击充币页面
 */
@Data
@Accessors(chain = true)
@TableName("user_memo")
public class UserMemo extends Model<UserMemo> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    /**
     * userId
     */
    private Long userId;

    /**
     * 用户EOS充币唯一标识
     */
    private Long memo;

    /**
     * 用户XRP充币唯一标识
     * 取值范围[0, int最大值]
     */
    private Long tag;

    /**
     * 创建时间
     */
    private Date created;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }
}
